#!/bin/bash

# 查询程序，并得到 pid
yhs_pid=`ps -ef | grep "yhs_start.sh"  | grep -v grep | awk '{print $2}'`
run_pid=`ps -ef | grep "run_robot"  | grep -v grep | awk '{print $2}'`

# kill , 关闭进程
if [ -n "${yhs_pid}" ] || [ -n "${run_pid}" ]
then
    echo "pid = "${run_pid}
    kill -9 ${run_pid}
    kill -9 ${yhs_pid}
    echo "进程已 kill 成功"
else
	echo "进程 pid: ${yhs_pid} 不存在！"
fi

